<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    @include('comm/layuiCommStyle')
    @include('comm/comm')
    <title>wenjian列表</title>
</head>
<body>



<div style="padding: 15px;">
    <blockquote class="layui-elem-quote">
        文件列表
    </blockquote>
</div>




<div class="container">

    <table class="layui-table">
        <colgroup>
            <col>
            <col>

            <col width="150">
        </colgroup>
        <thead>
        <tr>
            <th>文件名称</th>
            <th>大小</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        @foreach ($res as $k=>$v)
        <tr>
            <td>{{$v}}</td>
            <td>XXX</td>

            <th>
                <div class="layui-btn-group">
                    <a href="javascript:delFile('{{$v}}')">
                        <button class="layui-btn layui-btn-sm">
                            <i class="layui-icon">&#xe640;</i>
                        </button>
                    </a>
                    <a href="">
                        <button class="layui-btn layui-btn-sm">
                            <i class="layui-icon">&#xe681;</i>
                        </button>
                    </a>

                </div>

            </th>
        </tr>
        @endforeach

        </tbody>
    </table>

</div>






</body>

<script>
function delFile(name)
{

    layui.use('layer', function(){
        var layer = layui.layer;

        layer.confirm('删除文件确认？？', {
            btn: ['删除文件', '取消删除'] //可以无限个按钮
            ,btn1: function(index, layero){
                //按钮【按钮1】的回调
                url="/admins/report/filedel?file="+name;
                bools = ajaxUrl(url);

                return true;
            }
            ,btn2: function(index, layero){
                //按钮【按钮2】的回调
                layer.close(index);
                return false;
            }
        });
    });

}

function ajaxUrl(rui)
{
    $.get(rui,function(data,status){
        alert("数据: " + data + "\n状态: " + status);
        if(status='success')
        {
            window.location.reload();
        }
    });

}


</script>
</html>